import React from 'react';
import PropTypes from 'prop-types';
import './index.css';

import Item from '../Item';
export default class TodoList extends React.Component {
  static propsTyps = {
    todos: PropTypes.object.isRequired,
    updateTodo: PropTypes.func.isRequired,
    delTodo: PropTypes.func.isRequired
  };
  render() {
    const { todos } = this.props;
    return (
      <div className='min-h200'>
        <ul className="list-box">
          {todos.map(todo => {
            return <Item key={todo.id} {...todo} {...this.props}></Item>;
          })}
        </ul>
      </div>
    );
  }
}
